namespace TomatoBreak.Infrastructure
{
    using System;
    using System.Web.Mvc;

    public class ModelBindersRegistrar : IRegistrar
    {
        private readonly TypeMappingRegistry<object, IModelBinder> registry;

        public ModelBindersRegistrar(TypeMappingRegistry<object, IModelBinder> registry)
        {
            if (registry == null)
            {
                throw new ArgumentNullException("registry");
            }

            this.registry = registry;
        }

        public void Register()
        {
            registry.Register<DateTime, DateBinder>();
        }
    }
}